Skip to content

Uncheck 'Select all' header cell on page change #1196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 23, 2025

Conversation

klaraloreen
Copy link
Contributor

Fixes: #1193.

Adds a state variable to control the value of the "Select all" header cell on page change.

Screenshot before issue (page just changed):
Screenshot from 2025-05-07 09-24-31

Screenshot after issue (page just changed):
Screenshot from 2025-05-07 09-43-23

Copy link
Contributor

github-actions bot commented May 7, 2025

Hi @klaraloreen
Thank you for contributing to the Opencast Admin UI.
We noticed that you have not yet filed an Individual Contributor License Agreement. Doing that (once) helps us to ensure that Opencast stays free for all. If you make your contribution on behalf of an institution, you might also want to file a Corporate Contributor License Agreement (giving you as individual contributor a bit more security as well). It can take a while for this bot to find out about new filings, so if you just filed one or both of the above do not worry about this message!
Please let us know if you have any questions regarding the CLA.

EDIT(@lkiesow ): Klara did submit an ICLA to Apereo. It usually takes a while for Apereo to process the submissions. Meanwhile, please ignore the ICLA test and point reviewers to this comment if anyone asks on further pull requests.

Copy link
Contributor

github-actions bot commented May 7, 2025

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-1196

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/opencast-admin-interface:pr-1196

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

@klaraloreen klaraloreen marked this pull request as draft May 7, 2025 07:54
Copy link
Contributor

github-actions bot commented May 7, 2025

This pull request is deployed at test.admin-interface.opencast.org/1196/2025-05-22_14-37-07/ .
It might take a few minutes for it to become available.

@Arnei Arnei added the type:bug Something isn't working label May 7, 2025
@klaraloreen klaraloreen marked this pull request as ready for review May 7, 2025 14:11
@lkiesow
Copy link
Member

lkiesow commented May 13, 2025

Looks good for pagination. But I found another problem:

  • The select all checkbox keeps being selected after starting an action (Select all → Action → Start Task → e.g. run „Republish Metadata“)

@lkiesow lkiesow self-assigned this May 13, 2025
@ferishili
Copy link
Contributor

ferishili commented May 15, 2025

Hi @klaraloreen, thanks for your work.
I like the idea of providing the state val and checked props, however this would (I assume) only uncheck the header as written in the title. But we should also cover the deselection of the selected items, so I introduce the mechanism (in a method) here: #1286
There, I use ref to target the header checkbox too!
So, I would recommend going as follows:

  • Wait for Deselect table rows when sorting #1286 to be merged first & rebase to this PR.
  • No using state & checked props! in favor of reusing the method in sync mode!
  • Use the deselect method also in place related to pagination!

Thanks & BR

Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@klaraloreen
Copy link
Contributor Author

Hi @ferishili, thanks for your improvements! I removed the state variable and used the deselect method instead, just like you suggested.

@ferishili ferishili self-requested a review May 20, 2025 12:29
@ferishili
Copy link
Contributor

ferishili commented May 20, 2025

Thanks, @klaraloreen,
it works as expected, however, it would also make sense to force that deselection on the page number dropdown.
What do you think?

[UPDATE]: It is decided; the correct way in terms of UX is to deselect all items even when we change the number of rows per page, therefore, we need to take care of that!
PS: as soon as this change is also pushed to the PR, it is good to go!

Copy link
Contributor

@ferishili ferishili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klaraloreen, please consider adding forceDeseletAll() in this method as well:

const changePageSize = (size: number) => {

@klaraloreen
Copy link
Contributor Author

Hi @ferishili, thanks for your suggestion! I added the method to force deselection on change of the page size. Sorry for the late reply!

@klaraloreen klaraloreen requested a review from ferishili May 22, 2025 14:40
Copy link
Contributor

@ferishili ferishili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @klaraloreen

@Arnei Arnei merged commit 7efaffa into opencast:main May 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dismiss selection if table content changes
4 participants